<?php
class Share_model extends Model {
	var $_table = 'table_share_list';
	function __construct() {
		parent::__construct();
		$this->load->database('default');
	}
	
	function num($condition = array()) {
		if($condition) {
			$this->db->where($condition);
		}
		$this->db->get($this->_table);
		return $this->db->count_all($this->_table);
	}

	function retrive($condition = array(),$order = '' ,$limit = '') {
		if(count($condition)!=0) {
			$this->db->where($condition);
		}
		if($order) {
			$this->db->order_by($order);
		}
		if($limit) {
			$a = explode(",",$limit);
			$this->db->limit($a[0],$a[1]);
		}
		return $this->db->get($this->_table)->result_array();
	}
}
?>